﻿
/*
NAILSUPERSTORE ® COMPANY
 
[HISTORY]
Created By  	: NGUYEN VAN TY
Created Date	: 12/07/2010
Modified By     :
Modified Date   :
Note            :

*/

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using CommonTagTime.DataAccess;
using CommonTagTime.ModelObject;
namespace CommonTagTime.Business
{
    public class busProductCategory
    {
        //------------------------------------------------
        //FIELD TABLE
        //------------------------------------------------
        public const string TABLE = "ProductCategory"; 
        public const string PRODUCTID = "ProductID";
        public const string CATEGORYID = "CategoryID";       
        public const string CURRENTPAGE = "CurrentPage";
        public const string PAGESIZE = "PageSize";     
        public const string TOTALRECORDS = "TotalRecords";
        public const string CONDITION = "Condition";


        private daoProductCategory _daoProductCategory;
        //------------------------------------------------
        //PUBLIC
        //------------------------------------------------
        public busProductCategory()
        {
            _daoProductCategory = new daoProductCategory();
        }
        public bool Insert(ProductCategory objProductCategory)
        {
            return _daoProductCategory.Insert(objProductCategory);
        }
        public bool Insert(ProductCategoryCollection lstProductCategory)
        {
            foreach (ProductCategory objCate in lstProductCategory)
            {
                _daoProductCategory.Insert(objCate);
            }
            return true;
        }

        public ProductCategoryCollection GetListByProductID(int productID)
        {
            if (productID <= 0)
                return null;
            return _daoProductCategory.GetListByProductID(productID);
        }
        public bool DeleteByProduct(int productId)
        {
            return _daoProductCategory.DeleteByProduct(productId);
        }
        public ProductCategoryCollection GetListByCategoryID(int cateID)
        {
            return _daoProductCategory.GetListByCategoryID(cateID);
        }
    }

}
